package com.cskaoyan.market.validator;

import com.cskaoyan.market.constrain.LegalOrder;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author lixianbiao
 * @since 2024/06/28 19:26
 */
public class LegalOrderValidator implements ConstraintValidator<LegalOrder,String> {
    @Override
    public boolean isValid(String string, ConstraintValidatorContext constraintValidatorContext) {
        if(!("asc".equals(string) || "desc".equals(string))){
            return false;
        }
        return true;
    }
}